All employees in Germany pay for public pension insurance (gesetzliche Rentenversicherung). For self-employed people, pension insurance is optional.
Pension insurance pays for your pension. When you retire, you will get a monthly pension from the state.
Public pension insurance costs 18.6% of your income. You pay 9.3%, and your employer pays the rest. It’s taken directly from your paycheck.
If you are self-employed, you pay the full 18.6% yourself, unless you join the Künstlersozialkasse or a freelancer cooperative.
If you leave Germany, you can sometimes get your pension payments back.